gtk4.git
6 years agox11: Fix key event state translation
Matthias Clasen [Sat, 21 Mar 2020 14:25:06 +0000 (10:25 -0400)]
x11: Fix key event state translation

In the event refactoring, a bit was lost.

This makes Ctrl-Shift-i work again to open
the inspector.

6 years agoMerge branch 'new-text-attributes' into 'master'
Matthias Clasen [Sat, 21 Mar 2020 05:56:22 +0000 (05:56 +0000)]
Merge branch 'new-text-attributes' into 'master'

New text attributes

See merge request GNOME/gtk!1547

6 years agoMake overline support conditional
Matthias Clasen [Sat, 21 Mar 2020 04:44:04 +0000 (00:44 -0400)]
Make overline support conditional

The ci image does not have Pango 1.45, so for the
time being, make the overline support conditional
on Pango being new enough.

6 years agoRequire pango 1.44.4
Matthias Clasen [Sat, 21 Mar 2020 04:39:17 +0000 (00:39 -0400)]
Require pango 1.44.4

This lets use use the insert-hyphen attribute
unconditionally.

6 years agogtk-demo: Add hyphenation control to the markup demo
Matthias Clasen [Sat, 21 Mar 2020 03:51:36 +0000 (23:51 -0400)]
gtk-demo: Add hyphenation control to the markup demo

6 years agogtk-demo: Allow word breaking in the markup demo
Matthias Clasen [Sat, 21 Mar 2020 03:51:08 +0000 (23:51 -0400)]
gtk-demo: Allow word breaking in the markup demo

We want to show hyphenation control here.

6 years agotextbuffer: Parse overline and hyphenation attributes
Matthias Clasen [Sat, 21 Mar 2020 03:56:41 +0000 (23:56 -0400)]
textbuffer: Parse overline and hyphenation attributes

When inserting Pango markup into a text buffer, translate
Pango attributes for overlines and hyphenation control
into the corresponding text tag properties.

6 years agotextlayout: Handle new text tag properties
Matthias Clasen [Sat, 21 Mar 2020 03:56:04 +0000 (23:56 -0400)]
textlayout: Handle new text tag properties

Translate tag properties for overlines and
hyphenation control into Pango attributes.

6 years agotexttag: Support overline and hyphenation control
Matthias Clasen [Sat, 21 Mar 2020 03:54:39 +0000 (23:54 -0400)]
texttag: Support overline and hyphenation control

Add support for recently added Pango attributes
for overlines and hyphenation control. The new
properties of GtkTextTag are
overline, overline-rgba, allow-breaks, show-spaces
and insert-hyphens.

6 years agoMerge branch 'master_MR1290' into 'master'
Carlos Garnacho [Fri, 20 Mar 2020 20:20:41 +0000 (20:20 +0000)]
Merge branch 'master_MR1290' into 'master'

Copy of !1290 for master

Closes #2365

See merge request GNOME/gtk!1546

6 years agoMerge branch 'wip/chergert/fix-class-private-data-usage' into 'master'
Matthias Clasen [Fri, 20 Mar 2020 18:49:58 +0000 (18:49 +0000)]
Merge branch 'wip/chergert/fix-class-private-data-usage' into 'master'

Fix GtkWidgetClassPrivate data usage

See merge request GNOME/gtk!1545

6 years agowidget: fix class private data usage to be _init() safe
Christian Hergert [Fri, 20 Mar 2020 16:22:29 +0000 (09:22 -0700)]
widget: fix class private data usage to be _init() safe

Before this commit, adding GtkWidgetAction to class private data would
require copying the actions to each subclass as they were built or
modified. This was convenient in that it is a sort of "copy on write"
semantic.

However, due to the way that GTypeInstance works with base _init()
functions, the "g_class" pointer in GTypeInstance is updated as each
_init() function is called. That means you cannot access the subclasses
class private data, but only the parent class private data.

If instead we use a singly linked list of GtkWidgetAction, each subclass
has their own "head" yet all subclasses share the tail of the
GtkWidgetAction chain.

This creates one bit of complexity though. You need a stable way to know
which "bit" is the "enabled" bit of the action so we can track enabled
GAction state. That is easily solved by calculating the distance to the
end of the chain for a given action so that base classes sort ahead of
subclasses. Since the parent class always knows its parent's actions, the
position is stable.

A new dynamic bitarray helper also helps us avoid allocations in all the
current cases (up to 64 actions per widget) and dynamically switches to
malloc if that is to ever be exceeded.

6 years agowidget: move class private data to gtkwidgetprivate.h
Christian Hergert [Fri, 20 Mar 2020 16:16:30 +0000 (09:16 -0700)]
widget: move class private data to gtkwidgetprivate.h

We want access to the private data from the action muxer so we can just
move the structures to the gtkwidgetprivate.h header. Alternatively we
could create accessors, but given that we'll probably need to use this
in other areas, seems reasonable to just put it there.

6 years agoMerge branch 'test-protocol' into 'master'
Matthias Clasen [Fri, 20 Mar 2020 18:12:09 +0000 (18:12 +0000)]
Merge branch 'test-protocol' into 'master'

Test protocol: TAP

See merge request GNOME/gtk!1543

6 years agotestsuite: disable performance tests
Matthias Clasen [Fri, 20 Mar 2020 17:47:58 +0000 (13:47 -0400)]
testsuite: disable performance tests

For some reason, these tests are flaky in ci,
they always work locally for me. So, until
we use the data these tests produce for something,
lets just turn them off.

6 years agoMerge branch 'wip/carlosg/text-handle-natives' into 'master'
Matthias Clasen [Fri, 20 Mar 2020 17:29:17 +0000 (17:29 +0000)]
Merge branch 'wip/carlosg/text-handle-natives' into 'master'

Make text handles use native surfaces

See merge request GNOME/gtk!1487

6 years agogkimmulticontext: Fix crash due to leaked signal handler
Alexandr Miloslavskiy [Tue, 17 Dec 2019 11:44:33 +0000 (12:44 +0100)]
gkimmulticontext: Fix crash due to leaked signal handler

The problem is caused by gtk_im_multicontext_set_slave(), which forgets
to disconnect these signal handlers:
* gtk_im_multicontext_retrieve_surrounding_cb
* gtk_im_multicontext_delete_surrounding_cb

If slave GtkImContext emits signal after GtkIMMulticontext context is
destroyed, this leads to reading freed memory, sometimes causing a crash.

Fixes: #2365
6 years agoMerge branch 'ci-dbus-launch' into 'master'
Emmanuele Bassi [Fri, 20 Mar 2020 16:13:07 +0000 (16:13 +0000)]
Merge branch 'ci-dbus-launch' into 'master'

ci: Add dbus-launch to the Docker build

See merge request GNOME/gtk!1544

6 years agotestsuite: Fix an a11y test
Matthias Clasen [Fri, 20 Mar 2020 16:09:21 +0000 (12:09 -0400)]
testsuite: Fix an a11y test

The derive test wasn't producing TAP, so
running it as part of a tap testsuite wasn't
going well. Fix that.

6 years agotestsuite: Tell meson we use TAP
Matthias Clasen [Fri, 20 Mar 2020 13:39:56 +0000 (09:39 -0400)]
testsuite: Tell meson we use TAP

This makes meson actually parse the individual test
results. Most of the time, it does not make a difference,
but one case where it does is when all the individual
tests of a binary are skipped, meson will mark the
test as skipped.

6 years agoreftests: Fix an xfail to work
Matthias Clasen [Fri, 20 Mar 2020 15:52:54 +0000 (11:52 -0400)]
reftests: Fix an xfail to work

The background-image-multiple.ref.ui file uses
non-existing properties, which gives us a g_warning,
and the glib test framework insists on treating
warnings as fatal, so we end up doing exit(133),
which in turn makes the meson TAP parser ignore
its xfails.

Comment out the nonexisting properties, so we can
fail properly, and then in turn xfail properly.

6 years agotestsuite: Don't exit unsuccessfully when using TAP
Matthias Clasen [Fri, 20 Mar 2020 15:43:51 +0000 (11:43 -0400)]
testsuite: Don't exit unsuccessfully when using TAP

The meson TAP parser doesn't take this lightly and
forgets all about xfails when we exit(1), so don't.

6 years agoci: Add dbus-launch to the Docker build
Emmanuele Bassi [Fri, 20 Mar 2020 15:36:39 +0000 (15:36 +0000)]
ci: Add dbus-launch to the Docker build

6 years agogtktextview: Set magnifier popover on top
Carlos Garnacho [Fri, 20 Mar 2020 11:23:03 +0000 (12:23 +0100)]
gtktextview: Set magnifier popover on top

At the bottom, it sometimes has to fight for the same position than
text handles, besides might not be ergonomically convenient (eg.
finger/hand partly covering the popover). Move it at the top to fix
both.

6 years agogtktext: Set magnifier popover on top
Carlos Garnacho [Fri, 20 Mar 2020 11:20:54 +0000 (12:20 +0100)]
gtktext: Set magnifier popover on top

At the bottom, it sometimes has to fight for the same position than
text handles, besides might not be ergonomically convenient (eg.
finger/hand partly covering the popover). Move it at the top to fix
both.

6 years agogtkpopover: Re-present surface if position/pointing-to change while visible
Carlos Garnacho [Thu, 27 Feb 2020 17:08:46 +0000 (18:08 +0100)]
gtkpopover: Re-present surface if position/pointing-to change while visible

This ensures the popover will follow the new position parameters. This is
necessary for popovers like the text magnifier that can be repositioned
while visible.

6 years agogtkpopover: Ensure the pointed to rectangle has a minimum w/h
Carlos Garnacho [Thu, 27 Feb 2020 17:07:38 +0000 (18:07 +0100)]
gtkpopover: Ensure the pointed to rectangle has a minimum w/h

On wayland, protocol errors will be raised if the rectangle width/height
are 0. Avoid that situation so it's valid to all popovers.

6 years agogtkwindow: Remove internal popover API
Carlos Garnacho [Mon, 3 Feb 2020 20:52:43 +0000 (21:52 +0100)]
gtkwindow: Remove internal popover API

This was only used by text handles, and not anymore.

6 years agogtktexthandle: Refactor and use native surfaces
Carlos Garnacho [Mon, 3 Feb 2020 14:59:49 +0000 (15:59 +0100)]
gtktexthandle: Refactor and use native surfaces

Instead of being a GObject managing two GtkWidgets, make GtkTextHandle
a GtkWidget subclass, representing a single handle.

From the perspective of users (GtkText and GtkTextView), this is not a
big leap since they have to be aware of a great deal of text handles'
state. It actually makes things more direct and simple.

With text handles being widgets, those can be actual children of the
widget, and may have their own GdkSurface that we move around at will.
This is the second major aspect of this refactor.

6 years agoreftests: Don't run tests with --verbose
Matthias Clasen [Fri, 20 Mar 2020 14:42:52 +0000 (10:42 -0400)]
reftests: Don't run tests with --verbose

Unexpected output tends to break TAP.

6 years agogsk: Don't unconditionally spew to stdout
Matthias Clasen [Fri, 20 Mar 2020 14:25:14 +0000 (10:25 -0400)]
gsk: Don't unconditionally spew to stdout

6 years agotestsuite: Don't g_print from tests
Matthias Clasen [Fri, 20 Mar 2020 13:39:35 +0000 (09:39 -0400)]
testsuite: Don't g_print from tests

This breaks the TAP output.

6 years agotestsuite: Fix the accessible test
Matthias Clasen [Fri, 20 Mar 2020 12:33:21 +0000 (08:33 -0400)]
testsuite: Fix the accessible test

This test was happily doing nothing.

6 years agoMerge branch 'disable-window-test-2' into 'master'
Matthias Clasen [Fri, 20 Mar 2020 13:42:38 +0000 (13:42 +0000)]
Merge branch 'disable-window-test-2' into 'master'

Disable window test 2

See merge request GNOME/gtk!1541

6 years agotemporarily disable window test
Matthias Clasen [Thu, 19 Mar 2020 15:25:38 +0000 (11:25 -0400)]
temporarily disable window test

This test was broken by the GdkToplevel refactoring,
and needs a big gtkwindow.c configure request cleanup
before it will work again.

6 years agoRevert "Merge branch 'disable-window-test' into 'master'"
Matthias Clasen [Thu, 19 Mar 2020 22:03:16 +0000 (18:03 -0400)]
Revert "Merge branch 'disable-window-test' into 'master'"

This reverts commit 3ac4c76b18cc89a841ce09f0943539f16988fd21, reversing
changes made to 6ec96d2e989d029a303b8b20ec72b86f974c0e87.

6 years agoMerge branch 'disable-window-test' into 'master'
Matthias Clasen [Thu, 19 Mar 2020 19:35:42 +0000 (19:35 +0000)]
Merge branch 'disable-window-test' into 'master'

Disable window test

See merge request GNOME/gtk!1540

6 years agoFix the action test
Matthias Clasen [Thu, 19 Mar 2020 18:29:37 +0000 (14:29 -0400)]
Fix the action test

We have a test that enumerates the GtkText actions,
so when a new open appears, the test needs to be updated.

6 years agoFix a compiler warning
Matthias Clasen [Thu, 19 Mar 2020 18:13:26 +0000 (14:13 -0400)]
Fix a compiler warning

6 years agotemporarily disable window test
Matthias Clasen [Thu, 19 Mar 2020 15:25:38 +0000 (11:25 -0400)]
temporarily disable window test

This test was broken by the GdkToplevel refactoring,
and needs a big gtkwindow.c configure request cleanup
before it will work again.

6 years agotext view: Fix touch selection
Matthias Clasen [Thu, 19 Mar 2020 13:46:53 +0000 (09:46 -0400)]
text view: Fix touch selection

We forgot to allocated that popover.

6 years agowidget: Drop the ::popup-menu signal
Matthias Clasen [Thu, 19 Mar 2020 04:56:46 +0000 (00:56 -0400)]
widget: Drop the ::popup-menu signal

This is now done in widgets which have context
menus.

6 years agoplacesview: Stop using ::popup-menu
Matthias Clasen [Thu, 19 Mar 2020 04:52:05 +0000 (00:52 -0400)]
placesview: Stop using ::popup-menu

This signal is going away.

6 years agofilechooser: Stop using ::popup-menu
Matthias Clasen [Thu, 19 Mar 2020 04:07:45 +0000 (00:07 -0400)]
filechooser: Stop using ::popup-menu

This signal is going away.

6 years agomountoperation: Stop using ::popup-menu
Matthias Clasen [Thu, 19 Mar 2020 02:56:53 +0000 (22:56 -0400)]
mountoperation: Stop using ::popup-menu

We can just use a shortcut controller directly.

6 years agogtk-demo: Stop emitting ::popup-menu
Matthias Clasen [Thu, 19 Mar 2020 02:40:13 +0000 (22:40 -0400)]
gtk-demo: Stop emitting ::popup-menu

The signal was not used anyway, in the font explorer demo.

6 years agocolorchooser: Stop using ::popup-menu
Matthias Clasen [Thu, 19 Mar 2020 02:36:31 +0000 (22:36 -0400)]
colorchooser: Stop using ::popup-menu

This signal is going away. Use an action instead.

6 years agorange: Remove ::popup-menu emission
Matthias Clasen [Thu, 19 Mar 2020 01:57:51 +0000 (21:57 -0400)]
range: Remove ::popup-menu emission

This signal is going away, and having context menus
on sliders is not really a thing anyway.

6 years agoscrollbar: Remove :popup-menu forwarding
Matthias Clasen [Thu, 19 Mar 2020 01:55:08 +0000 (21:55 -0400)]
scrollbar: Remove :popup-menu forwarding

This signal is going away.

6 years agoemojichooser: Stop using ::popup-menu
Matthias Clasen [Wed, 18 Mar 2020 20:52:52 +0000 (16:52 -0400)]
emojichooser: Stop using ::popup-menu

This signal is going away. Use an action instead.

6 years agoUse an action for the context menu keybinding
Matthias Clasen [Mon, 16 Mar 2020 02:25:09 +0000 (22:25 -0400)]
Use an action for the context menu keybinding

The ::popup-menu signal is going away.

6 years agoPrint mnemonic triggers clearly
Matthias Clasen [Mon, 16 Mar 2020 02:10:39 +0000 (22:10 -0400)]
Print mnemonic triggers clearly

6 years agoinspector: Show shortcuts
Matthias Clasen [Mon, 16 Mar 2020 00:48:31 +0000 (20:48 -0400)]
inspector: Show shortcuts

At a tab that lists the shortcuts contained in a
GtkShortcutController.

6 years agoOnly create a class shortcut controller if we have shortcuts
Matthias Clasen [Sun, 15 Mar 2020 22:24:52 +0000 (18:24 -0400)]
Only create a class shortcut controller if we have shortcuts

No point in creating objects that just hold empty lists.

6 years agowidget: Name the controllers
Matthias Clasen [Sun, 15 Mar 2020 22:20:58 +0000 (18:20 -0400)]
widget: Name the controllers

6 years agowindow: Name the the controllers
Matthias Clasen [Sun, 15 Mar 2020 22:20:40 +0000 (18:20 -0400)]
window: Name the the controllers

6 years agoshortcutmanager: Name the controllers
Matthias Clasen [Sun, 15 Mar 2020 22:20:24 +0000 (18:20 -0400)]
shortcutmanager: Name the controllers

This is helpful in the inspector.

6 years agoMove shortcut manager initialization code
Matthias Clasen [Sun, 15 Mar 2020 21:38:56 +0000 (17:38 -0400)]
Move shortcut manager initialization code

It is just too ugly to use quarks across multiple
source files, so add a private helper function that
attaches the controllers.

6 years agofilechooser: Trigger the location popup via bindings
Benjamin Otte [Sun, 26 Aug 2018 16:39:51 +0000 (18:39 +0200)]
filechooser: Trigger the location popup via bindings

Simplifies code quite a bit.

6 years agoaccels: Remove GtkAccelGroup
Benjamin Otte [Fri, 24 Aug 2018 06:46:54 +0000 (08:46 +0200)]
accels: Remove GtkAccelGroup

6 years agotestmenubutton: Don't create a GtkAccelGroup
Benjamin Otte [Fri, 24 Aug 2018 05:41:28 +0000 (07:41 +0200)]
testmenubutton: Don't create a GtkAccelGroup

It's unused.

6 years agotestsuite: Remove GtkAccelGroup usage
Benjamin Otte [Fri, 24 Aug 2018 05:40:49 +0000 (07:40 +0200)]
testsuite: Remove GtkAccelGroup usage

6 years agowidget: Remove gtk_widget_add_accelerator()
Benjamin Otte [Fri, 24 Aug 2018 05:34:23 +0000 (07:34 +0200)]
widget: Remove gtk_widget_add_accelerator()

People should use shortcut controllers instead (global, capture).

A side effect of this is that GtkAccelLabel now lost its method to
magically look up accelerators to display. Somebody needs to add that
back later.

6 years agodoc tools: Create AccelLabel image without using GtkAccelGroup
Benjamin Otte [Fri, 24 Aug 2018 05:38:44 +0000 (07:38 +0200)]
doc tools: Create AccelLabel image without using GtkAccelGroup

6 years agotestgtk: Port keyval example to shortcut controllers
Emmanuele Bassi [Thu, 6 Feb 2020 16:55:34 +0000 (16:55 +0000)]
testgtk: Port keyval example to shortcut controllers

6 years agoshortcutcontroller: Implement GtkBuildable
Benjamin Otte [Fri, 24 Aug 2018 05:00:12 +0000 (07:00 +0200)]
shortcutcontroller: Implement GtkBuildable

Use it to allow adding shortcuts to the controller via the usual <child>
method.

6 years agoshortcutaction: INtegrate with GtkBuilder property parsing
Benjamin Otte [Fri, 24 Aug 2018 04:58:44 +0000 (06:58 +0200)]
shortcutaction: INtegrate with GtkBuilder property parsing

<property name="action">action(win.quit)</property> style action
specifications now work for GtkShortcutAction properties.

6 years agoshortcuttrigger: Add gtk_shortcut_triger_new_parse_string()
Benjamin Otte [Thu, 23 Aug 2018 19:07:36 +0000 (21:07 +0200)]
shortcuttrigger: Add gtk_shortcut_triger_new_parse_string()

And hook it up into the GtkBuilder infrastructure.

6 years agoapplication: Replace accelerator handling with shortcuts
Benjamin Otte [Wed, 22 Aug 2018 23:23:24 +0000 (01:23 +0200)]
application: Replace accelerator handling with shortcuts

API remains the same, but activation is now done via a
shortcutcontroller.

The code uses a controller with global scope so that the
shortcuts are managed with all the other global shortcuts.

6 years agoaccel: Add display arg to gtk_accelerator_parse_with_keycode()
Benjamin Otte [Mon, 20 Aug 2018 22:44:47 +0000 (00:44 +0200)]
accel: Add display arg to gtk_accelerator_parse_with_keycode()

It was using the default display unconditionally.

6 years agoaccelerators: Make gtk_accelerator_parse() return TRUE/FALSE
Benjamin Otte [Mon, 20 Aug 2018 17:45:51 +0000 (19:45 +0200)]
accelerators: Make gtk_accelerator_parse() return TRUE/FALSE

A parse function should return success or not. So do that.

6 years agoshortcuttrigger: Add hash(), equal(), and compare() functions
Benjamin Otte [Mon, 20 Aug 2018 07:18:59 +0000 (09:18 +0200)]
shortcuttrigger: Add hash(), equal(), and compare() functions

Those are useful for putting triggers in hash tables or getting sorted
output.

6 years agoshortcuts: Mananage managed shortcuts with a custom model
Benjamin Otte [Mon, 20 Aug 2018 04:42:22 +0000 (06:42 +0200)]
shortcuts: Mananage managed shortcuts with a custom model

Reduce the amount of special casing by using a list model
for global and managed shortcuts, too.

This way, the ListModel API will work for the ShortcutController in the
GtkShortcutManager and GtkRoot.

The only special case remaining is shortcut activation, which needs to
pass the right widget to the controller in the global/managed case.

6 years agoshortcutaction: Add gtk_shortcut_action_to_string()
Benjamin Otte [Mon, 20 Aug 2018 02:45:10 +0000 (04:45 +0200)]
shortcutaction: Add gtk_shortcut_action_to_string()

For all but the callback action, we can print something useful.

6 years agowidget: Keep keybindings as a GListStore
Benjamin Otte [Mon, 20 Aug 2018 02:18:28 +0000 (04:18 +0200)]
widget: Keep keybindings as a GListStore

This way, we can use shortcut_controller_new_for_model() and avoid all
the special casing about run_class.

6 years agoshortcutcontroller: Add gtk_shortcut_controller_new_for_model()
Benjamin Otte [Sun, 19 Aug 2018 05:12:00 +0000 (07:12 +0200)]
shortcutcontroller: Add gtk_shortcut_controller_new_for_model()

This is mainly for internal use, but I can't see a reason to not have it
public for people who want to maintain their own lists.

I'm sure gnome-builder will never ever find a way to misuse it.

6 years agoshortcutcontroller: Implement GListModel
Benjamin Otte [Sun, 19 Aug 2018 04:26:50 +0000 (06:26 +0200)]
shortcutcontroller: Implement GListModel

After all, this controller is a list of shortcuts.

6 years agogtk-demo: Port the sliding puzzle demo to shortcuts
Benjamin Otte [Sat, 18 Aug 2018 18:01:27 +0000 (20:01 +0200)]
gtk-demo: Port the sliding puzzle demo to shortcuts

6 years agoshortcut: Change the API for creating shortcuts
Benjamin Otte [Sat, 18 Aug 2018 18:01:43 +0000 (20:01 +0200)]
shortcut: Change the API for creating shortcuts

When creating shortcuts, there almost always are a trigger and an action
available for use. So make gtk_shortcut_new() take those as arguments.

Also add gtk_shortcut_new_with_arguments() so people can easily pass
those in, too.

6 years agoshortcut: Add GtkShortcutAction
Benjamin Otte [Sat, 18 Aug 2018 05:32:11 +0000 (07:32 +0200)]
shortcut: Add GtkShortcutAction

Similar to GtkShortcutTrigger, GtkShortCutAction provides all the
different ways to activate a shortcut.

So far, these different ways are supported:

 - do nothing
 - Call a user-provided callback
 - Call gtk_widget_activate()
 - Call gtk_widget_mnemonic_activate()
 - Emit an action signal
 - Activate an action from the widget's action muxer
 - Activate a GAction

6 years agoaccelgroup: Remove unneeded APIs
Benjamin Otte [Fri, 17 Aug 2018 04:43:27 +0000 (06:43 +0200)]
accelgroup: Remove unneeded APIs

After the removal of GtkAccelMap, these things are no longer necessary.

6 years agogtk: Remove GtkAccelMap
Emmanuele Bassi [Thu, 6 Feb 2020 16:02:44 +0000 (16:02 +0000)]
gtk: Remove GtkAccelMap

Now that accel paths are gone, the object managing them isn't needed
anymore either.

6 years agogtk: Remove accel paths
Benjamin Otte [Fri, 17 Aug 2018 03:07:32 +0000 (05:07 +0200)]
gtk: Remove accel paths

It's an outdated technology now that everybody is using GActionGroups.

If somebody wanted to support changeable shortcuts, they'd need to
reintroduce it in another way.

6 years agoRemove GtkMnemonicHash
Benjamin Otte [Thu, 16 Aug 2018 05:55:49 +0000 (07:55 +0200)]
Remove GtkMnemonicHash

It's not used anymore.

6 years agowindow: Remove all old mnemonic handling API
Emmanuele Bassi [Thu, 6 Feb 2020 15:54:57 +0000 (15:54 +0000)]
window: Remove all old mnemonic handling API

6 years agoAdd GtkShortcutManager
Emmanuele Bassi [Thu, 6 Feb 2020 15:43:55 +0000 (15:43 +0000)]
Add GtkShortcutManager

This adds an interface for taking care of shortcut controllers with
managed scope.

Only GtkWindow currently implements this interface, so we need to ensure
that we check if any top-level widget we reach is a shortcuts manager
before we call into it.

6 years agolabel: Implement mnemonics using shortcuts
Benjamin Otte [Thu, 16 Aug 2018 03:43:37 +0000 (05:43 +0200)]
label: Implement mnemonics using shortcuts

6 years agoshortcut: Add gtk_shortcut_set_mnemonic_activate()
Benjamin Otte [Thu, 16 Aug 2018 03:18:01 +0000 (05:18 +0200)]
shortcut: Add gtk_shortcut_set_mnemonic_activate()

Makes the shortcut call gtk_widget_mnemonic_activate() upon activation.

6 years agoshortcuttrigger: Add support for mnemonics
Benjamin Otte [Thu, 16 Aug 2018 01:59:24 +0000 (03:59 +0200)]
shortcuttrigger: Add support for mnemonics

Mnemonics need to be triggered with help from the controllers (who
determine the modifiers). Support for that has been added, too.

Mnemonics do not use this yet though.

6 years agowindow: Put F10 accelerator into its own shortcut controller
Benjamin Otte [Wed, 15 Aug 2018 04:43:31 +0000 (06:43 +0200)]
window: Put F10 accelerator into its own shortcut controller

So instead of relying on gtk_window_activate_key(), it's now using
proper infrastructure.

6 years agowindow: Get rid of public APIs that shouldn't be
Benjamin Otte [Wed, 15 Aug 2018 04:19:52 +0000 (06:19 +0200)]
window: Get rid of public APIs that shouldn't be

Event controllers should have replaced all of them.
And if they haven't, apps need to fix their code (I'm
looking at you Gimp).

6 years agogdk: Remove GDK_RELEASE_MASK
Benjamin Otte [Wed, 15 Aug 2018 03:50:28 +0000 (05:50 +0200)]
gdk: Remove GDK_RELEASE_MASK

It was only ever supported by keybindings and those are gone now.

6 years agogtk-demo: Add a dumb demo for shortcut triggers
Benjamin Otte [Sat, 11 Aug 2018 23:40:03 +0000 (01:40 +0200)]
gtk-demo: Add a dumb demo for shortcut triggers

6 years agoshortcutcontroller: Add GtkShortcutScope
Benjamin Otte [Mon, 13 Aug 2018 14:02:27 +0000 (16:02 +0200)]
shortcutcontroller: Add GtkShortcutScope

Allow setting the scope for a controller. The scope determines at what
point in event propagation the shortcuts will be activated.

Local scope is the usual activation, global scope means that the root
widget activates the shortcuts - ie they are activated at the very
start of event propagation (for global capture events) or the very end
(for global bubble events).
Managed scope so far is unimplemented.

This is supposed to be used to replace accelerators and mnemonics.

6 years agoshortcuttrigger: Add gtk_shortcut_trigger_to_label()
Benjamin Otte [Mon, 13 Aug 2018 03:45:12 +0000 (05:45 +0200)]
shortcuttrigger: Add gtk_shortcut_trigger_to_label()

Provide a user-presentable string.

6 years agoaccelgroup: Add gtk_accel_group_print_label()
Benjamin Otte [Mon, 13 Aug 2018 03:19:05 +0000 (05:19 +0200)]
accelgroup: Add gtk_accel_group_print_label()

6 years agoaccellabel: Move gtk_accelerator_get_label() code
Benjamin Otte [Mon, 13 Aug 2018 02:59:49 +0000 (04:59 +0200)]
accellabel: Move gtk_accelerator_get_label() code

The function lives in gtkaccelgroup.c, so there's no need to have that
call a private function in another source file. Instead, make that
other source file call gtk_accelerator_get_label() instead.

6 years agoaccellabel: Get rid of class variables
Benjamin Otte [Mon, 13 Aug 2018 02:51:03 +0000 (04:51 +0200)]
accellabel: Get rid of class variables

We can just look them up as-needed, no need to cache them.

6 years agogtk: Remove bindings
Benjamin Otte [Sun, 12 Aug 2018 20:07:27 +0000 (22:07 +0200)]
gtk: Remove bindings

The whole binding functionality is now handled by shortcuts.

6 years agoevent controller focus: drop include
Matthias Clasen [Sun, 15 Mar 2020 03:42:38 +0000 (23:42 -0400)]
event controller focus: drop include

This header is not needed here, and it is going away.